<template>
	<view class="container">
		<view class="time">
			{{ detail.send_time_format }}
		</view>
		<view class="txt">[{{ detail.message_title }}] {{ detail.message_content }}</view>
	</view>
</template>

<script>
import api from '@/api/api';
export default {
	data() {
		return {
			id: null,
			detail: {}
		};
	},
	onLoad(e) {
		this.id = e.id;
	},
	onShow() {
		this.getDetail();
	},
	methods: {
		getDetail() {
			api.msgDetail({ message_id: this.id }).then((data) => {
				this.detail = data.data.info;
				if (this.detail.is_view == 0) {
					this.setView();
				}
			});
		},
		setView() {
			api.msgView({ message_ids: this.id });
		}
	}
};
</script>

<style lang="scss">
.container {
	padding: 20rpx;
	.time{
		font-size: 28rpx;
		margin-bottom: 10rpx;
	}
	.txt{
		font-size: 28rpx;
	}
}
</style>
